//
//  Home_MeetingHistoryCell.m
//  HuaRun2
//
//  Created by admin on 17/9/5.
//  Copyright © 2017年 Sunny. All rights reserved.
//

#import "Home_MeetingHistoryCell.h"
#import "Home_CompanyHistoryModel.h"
#import "Home_MeetingHistoryModel.h"

@implementation Home_MeetingHistoryCell

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/
#pragma mark - life cycle

- (void)dealloc {
NSLog(@"%@ dealloc", [self class]);
}

- (void)awakeFromNib {
[super awakeFromNib];
// Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
    
    // Configure the view for the selected state
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        
        [self viewInit];
        [self layoutInit];
    }
    return self;
}

- (void)viewInit {
    
    [super viewInit];
    [self.contentView addSubview:self.valueLab1];
    
}

- (void)layoutInit {
    
    [super layoutInit];
    
    weakself(ws);
    
    [self.valueLab1 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(ws.backView);
        make.left.mas_equalTo(ws.backView).offset(kMargin10);
        make.right.mas_equalTo(ws.backView).offset(-kMargin10);
        make.height.mas_equalTo(20);
    }];
    
}

#pragma mark setter getter
- (void)setCompanyHisModel:(Home_CompanyHistoryModel *)companyHisModel {
    _companyHisModel = companyHisModel;
    _valueLab1.text = [NSString stringWithFormat:@"%@%@", @"",
                       [NSString showSpaceStringWithStr:companyHisModel.name]];
}

- (void)setMeetingHisModel:(Home_MeetingHistoryModel *)meetingHisModel {
    _meetingHisModel = meetingHisModel;
    _valueLab1.text = [NSString stringWithFormat:@"%@%@", @"",
    [NSString showSpaceStringWithStr:_meetingHisModel.meetingName]];
}

- (UILabel *)valueLab1 {
    if (!_valueLab1) {
        self.valueLab1 = [UILabel new];
        _valueLab1.textAlignment = NSTextAlignmentLeft;
        _valueLab1.font = kGeneralFontSize;
        _valueLab1.textColor = [UIColor colorWithHex:@"3c3c3c"];
        _valueLab1.text = @"英文民";
//        _valueLab1.backgroundColor = kRandomColor;
    }
    return _valueLab1;
}

@end
